function Count(option, cells) {
  BgSprite.apply(this, arguments);
  this.cells = cells;
  this.change = 0;
  this.index = option.index || 0;
  this.n = option.n;

}
Count.prototype = {
  draw: function() {
    ctx.save();
    ctx.drawImage(this.img, this.n * 36, 0, this.cells[0].w, this.cells[0].h,
      this.left - this.cells[0].w, this.top, this.cells[0].w, this.cells[0].h);
    ctx.drawImage(this.img, 0 * 36, 0, this.cells[0].w, this.cells[0].h,
      this.left, this.top, this.cells[0].w, this.cells[0].h);
    ctx.drawImage(this.img, 10 * 36, 0, this.cells[0].w, this.cells[0].h,
      this.left + this.cells[0].w, this.top, this.cells[0].w, this.cells[0].h);
    ctx.restore();
  },
  update: function() {
    this.change++;
  }
}

function createCount(n, obj) {
  var cells = [{
    x: 0,
    y: 0,
    h: 49,
    w: 36
  }];
  var count = new Count({
    url: "img/coinText.png",
    x: obj.w,
    y: obj.h,
    n: n,
  }, cells);
  return count;
}
